import request from '@/utils/request'

// 查询题库列表
export function listQuestion(query) {
  return request({
    url: '/api/question/list',
    method: 'get',
    params: query
  })
}

// 查询问卷题库列表
export function detailListQuestion(query) {
  return request({
    url: '/api/question/detailList',
    method: 'get',
    params: query
  })
}

// 查询题库详细
export function getQuestion(questionBankId) {
  return request({
    url: '/api/question/' + questionBankId,
    method: 'get'
  })
}

// 新增题库
export function addQuestion(data) {
  return request({
    url: '/api/question',
    method: 'post',
    data: data
  })
}


// 新增题库
export function addPaperQuestion(data) {
  return request({
    url: '/api/question/detailAdd',
    method: 'post',
    data: data
  })
}


// 修改题库
export function updateQuestion(data) {
  return request({
    url: '/api/question',
    method: 'put',
    data: data
  })
}

// 删除题库
export function delQuestion(questionBankId) {
  return request({
    url: '/api/question/' + questionBankId,
    method: 'delete'
  })
}

// 删除试卷题库
export function delPaperQuestion(questionBankId,paperId) {
  return request({
    url: '/api/question/paperRemove/' + questionBankId + '/' + paperId,
    method: 'delete'
  })
}

